Skip to content

cmake: set /EHsc for MSVC — fixes boost::throw_exception LNK2019 (all Windows release builds) - #707

Merged
frstrtr merged 1 commit into
masterfrom
ci/msvc-ehsc-fix
Jul 15, 2026
Merged

cmake: set /EHsc for MSVC — fixes boost::throw_exception LNK2019 (all Windows release builds)#707
frstrtr merged 1 commit into
masterfrom
ci/msvc-ehsc-fix

Conversation

@frstrtr

@frstrtr frstrtr commented Jul 14, 2026

Copy link
Copy Markdown
Owner

The bug

The v0.2.1 release build (tag v0.2.1 @ 884a0aeb) produced all 5 coins on Linux + macOS-universal, but all 5 Windows x86_64 cells FAILED — including LTC, which built fine before. Root cause (from the ltc Windows log):

warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
boost_sentinel.obj : error LNK2019: unresolved external symbol "boost::throw_exception" ...
fatal error LNK1120: 2 unresolved externals

The pinned Conan windows-msvc.profile (#702) carries no exception flag, and Conan's toolchain doesn't guarantee CMake's default /EHsc. With exceptions disabled, Boost's inline boost::throw_exception (pulled in via asio/log/signals2) becomes an unresolved external. This killed the boost_sentinel gate first (it links Boost::log), so every coin's Windows cell died before its own build even ran — hence all 5 failing identically.

The fix

Set /EHsc explicitly for all MSVC targets in the root CMakeLists (coin binaries + the CI boost_sentinel). One line, MSVC-only; Linux/macOS untouched.

Verification path

Not workflow-scope — mergeable once green. After merge I'll re-tag v0.2.1 to the fixed master and re-run the release build; expect the 5 Windows packages to join the already-green Linux + macOS set for the complete all-coin v0.2.1.

… Windows builds)

The pinned Conan windows-msvc.profile (#702) does not carry an exception
flag, and Conan's toolchain does not guarantee CMake's default /EHsc. Without
it, MSVC compiles with exceptions disabled (warning C4530), so Boost's inline
boost::throw_exception (pulled in by asio/log/signals2) becomes an unresolved
external -> LNK2019/LNK1120. This failed the CI boost_sentinel gate first, so
ALL FIVE coins' Windows x86_64 release cells died before their own build ran.

Set /EHsc globally for MSVC so every target (coin binaries + boost_sentinel)
compiles with unwind semantics. Linux/macOS unaffected. Restores Windows
packaging for ltc/btc/dgb/dash/bch.
@frstrtr
frstrtr merged commit 743abe3 into master Jul 15, 2026
23 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant